import request from "@/utils/request";

// 注册接口
export function postRegister(data) {
	return request({
		url: "/register",
		method: "POST",
		data: data
	})
}

// 登录接口
export function postLogin(data) {
	return request({
		url: "/login",
		method: "post",
		data: data
	})
}

// 修改昵称接口
export function updateNickName(data) {
	return request({
		url: "/updateNickName",
		method: "post",
		data: data
	})
}

// 修改头像接口
export function updateAvatar(data) {
	return request({
		url: "/updateAvatar",
		method: "post",
		data: data
	})
}


// 修改用户背景接口
export function updateUserBg(data) {
	return request({
		url: "/updateUserBg",
		method: "post",
		data: data
	})
}

// 修改简介接口
export function updateDesc(data) {
	return request({
		url: "/updateDesc",
		method: "post",
		data: data
	})
}

// 我的接口
export function postFindMy(data) {
	return request({
		url: "/findMy",
		method: "get",
		params: data
	})
}

// 个人资料接口
export function findAccountInfo(data) {
	return request({
		url: "/findAccountInfo",
		method: "get",
		params: data
	})
}

// 找回密码接口
export function postRetrievePassword(data) {
	return request({
		url: "/retrievePassword",
		method: "POST",
		params: {
			appkey: "U2FsdGVkX19WSQ59Cg+Fj9jNZPxRC5y0xB1iV06BeNA="
		},
		data: data
	})
}

// 查询地址接口
export function findAddress(data) {
	return request({
		url: "findAddress",
		method: "GET",
		params: data
	})
}

// 查询订单接口
export function findOrder(data) {
	return request({
		url: "findOrder",
		method: "GET",
		params: data
	})
}

// 确认收货接口
export function receive(data) {
	return request({
		url: "/receive",
		method: "post",
		data: data
	})
}

// 删除订单接口
export function removeOrder(data) {
	return request({
		url: "/removeOrder",
		method: "POST",
		data: data
	})
}

// 修改密码接口
export function updatePassword(data) {
	return request({
		url: "/updatePassword",
		method: "POST",
		data: data
	})
}

// 注销账号接口
export function destroyAccount(data) {
	return request({
		url: "/destroyAccount",
		method: "POST",
		data: data
	})
}

// 退出登录接口
export function logout(data) {
	return request({
		url: "/logout",
		method: "POST",
		data: data
	})
}

// 获取邮箱验证码接口
export function emailValidCode(data) {
	return request({
		url: "/emailValidCode",
		method: "POST",
		data: data
	})
}

// 找回密码接口
export function retrievePassword(data) {
	return request({
		url: "/retrievePassword",
		method: "POST",
		data: data
	})
}

export default {
	postRegister,
	postLogin,
	postRetrievePassword,
	updateNickName
}
